/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.db.GroupManager;
/*    */ import com.newcrm.exception.DBException;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.sql.SQLException;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ 
/*    */ public class ShowUpdateGroup extends AbstractAction
/*    */ {
/* 21 */   private int id = 0;
/*    */ 
/*    */   public ShowUpdateGroup(AbstractHttpServlet servlet) {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public ShowUpdateGroup(AbstractHttpServlet servlet, String id) {
/* 28 */     super(servlet);
/* 29 */     this.id = Util.str2Int(id);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 35 */     GroupManager manager = new GroupManager();
/*    */     try {
/* 37 */       List result = manager.getGroupInfo(this.id);
/* 38 */       if ((result == null) || (result.get(0) == null)) {
/* 39 */         throw new NotFoundException();
/*    */       }
/*    */ 
/* 42 */       request.setAttribute("groupName", ((Map)result.get(0)).get("GroupName"));
/* 43 */       request.setAttribute("groupId", ((Map)result.get(0)).get("GroupId"));
/* 44 */       request.getRequestDispatcher("/groups_modify.jsp").forward(request, 
/* 45 */         response);
/* 46 */       return;
/*    */     } catch (DBException e) {
/* 48 */       e.printStackTrace();
/*    */     } catch (SQLException e) {
/* 50 */       e.printStackTrace();
/*    */     }
/*    */ 
/* 53 */     throw new NotFoundException();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ShowUpdateGroup
 * JD-Core Version:    0.6.1
 */